package com.cmos.um.web;

import com.alibaba.dubbo.config.annotation.Reference;
import com.alibaba.fastjson.JSONObject;
import com.cmos.um.iservice.IUserSatisfySV;
import com.cmos.um.utils.Result;
import com.cmos.um.utils.ResultUtil;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("ngcctcontrol/ws/interfaces")
public class UserSatisfyController {
    @Reference
    private IUserSatisfySV iUserSatisfySV;
    /**
     * 【操作】更新满意度接口
     *
     * @param params 参数集MAP（含params参数——此参数在输入函数时为Json字符串）
     * @return Map<String,Object> 返回的数据（MAP形式）
     */
    @PutMapping("/userSatisfy")
    public Result updateUserSatisfy(@RequestBody JSONObject params) {
        if(params.containsKey("params")){
            return iUserSatisfySV.updateUserSatisfy(params);
        }else {
            return ResultUtil.error("-9999","入参不符合规范");
        }
    }
}
